package 剑指Offer.easy;

public class 左旋字符串 {
    class Solution {
        public String reverseLeftWords(String s, int n) {
            char[] word = s.toCharArray();
            char[] tmp = new char[n];
            for (int i = 0; i < n; i++) {
                tmp[i] = word[i];
            }
            for (int i = n; i < word.length; i++) {
                word[i - n] = word[i];
            }
            int j = 0;
            for (int i = word.length - n; i < word.length; i++) {
                word[i] = tmp[j++];
            }
            return String.valueOf(word);
        }
    }
}
